<script>

export default {
  name: 'VipDetail',
  data () {
    return {
      formData: {

      },
      basePath: process.env.VUE_APP_BASE_PATH,
      show: false,
      idcard1Src: '',
      idcard2Src: ''
    }
  },
  methods: {
    init (id) {
      if (id) {
        this.$axios.get(`vip/info/${id}`).then(data => {
          this.formData = { ...data }
          this.idcard1Src = data.idcard1 ? this.basePath + data.idcard1 : ''
          this.idcard2Src = data.idcard2 ? this.basePath + data.idcard2 : ''
        }).catch(e => e)
      }
      this.show = true
    }
  }
}
</script>

<template>
<el-dialog title="会员详情" :visible.sync="show" width="40%">
  <el-form disabled :model="formData" ref="formRef" label-width="120px">
    <el-form-item label="用户名">
      <el-input v-model="formData.username"/>
    </el-form-item>
    <el-form-item label="昵称">
      <el-input v-model="formData.nickname"/>
    </el-form-item>
    <el-form-item label="邮箱">
      <el-input v-model="formData.email"/>
    </el-form-item>
    <el-form-item label="手机号">
      <el-input v-model="formData.phone"/>
    </el-form-item>
    <el-form-item label="身份证号">
      <el-input v-model="formData.idcard"/>
    </el-form-item>
    <el-form-item label="个人域名">
      <el-input v-model="formData.href"/>
    </el-form-item>
    <el-form-item label="个性签名">
      <el-input type="textarea" :rows="4" v-model="formData.profile"/>
    </el-form-item>
    <el-form-item label="认证时间">
      <el-input v-model="formData.authTime"/>
    </el-form-item>
    <el-form-item label="身份证正面">
      <div class="avatar-uploader"><img :src="idcard1Src" class="avatar" alt="图片异常"></div>
    </el-form-item>
    <el-form-item label="身份证反面">
      <div class="avatar-uploader"><img :src="idcard2Src" class="avatar" alt="图片异常"></div>
    </el-form-item>
    <el-form-item label="审核意见">
      <el-input type="textarea" :rows="4" v-model="formData.examContent"/>
    </el-form-item>
    <el-form-item label="审核人">
      <el-input v-model="formData.examUserinfoId"/>
    </el-form-item>
    <el-form-item label="审核时间">
      <el-input v-model="formData.examTime"/>
    </el-form-item>
    <el-form-item label="会员状态">
      <el-tag v-if="formData.userinfoStatus === 1" type="warning">注册</el-tag>
      <el-tag v-if="formData.userinfoStatus === 2" type="primary">提交</el-tag>
      <el-tag v-else-if="formData.userinfoStatus === 3" type="success">认证</el-tag>
      <el-tag v-else type="danger">拒绝</el-tag>
    </el-form-item>
  </el-form>
</el-dialog>
</template>

<style scoped lang="scss">

</style>
